Integrated circuit data processing systems, such as microprocessors and microcontrollers generally include onboard, or internal, memory for storing instructions and/or data. The internal memory may be composed of volatile memory, such as static random access memory (SRAM) or dynamic random access memory (DRAM), or non-volatile memory, such as electrically programmable read only memory (EPROM) or flash memory, or a combination of volatile or non-volatile memory. Generally, because of size and cost considerations, the amount of internal memory is not unlimited, and some applications may require that additional, expensive, external memory be used in the design.
Exceptions, or interrupts, are used in many data processing systems in response to external signal, errors, or unusual conditions arising in the execution of instructions. When an exception occurs, normal instruction execution stops, and the data processing system begins executing a specific exception routine that has been provided for handling the particular exception. There may be many types of exceptions and a different exception routine would be required for handling each exception type. For example, the exception routine for handling a reset will be different than the exception routine for handling an overflow condition. Also, a data processing system used in one application may require different exception routines than the same data processing system used in another application.
The internal memory space may be mapped into a number of prearranged consecutive locations in a tabular form for storing the exception routines. Each of the locations are mapped to contain a predetermined number of instructions for implementing one exception routine. However, mapping prearranged locations for the exception table may result in wasting valuable memory space if, for example, the exception routine does not require all of the memory space of the prearranged location.